package 补充.泛型;

import java.util.ArrayList;
import java.util.List;

public class TestGeneric2 {
    public static void main(String[] args) {
        List<?> list = null;
        list = new ArrayList<String>();
        list = new ArrayList<Integer>();
        list.add(null);
        System.out.println(list);
        List<Integer> l1=new ArrayList<Integer>();
        List<String> l2=new ArrayList<String>();
        l1.add(1100);
        l2.add("abc");
        read(l1);
        read(l2);

    }
    static void read(List<?> list){
        for(int i=0;i<list.size();i++){
            System.out.println(list.get(i));
        }
    }
}
